package com.ohuang.fakescreen.window

import android.app.Activity
import android.view.LayoutInflater
import android.view.View
import android.widget.TextView
import com.ohuang.fakescreen.R
import com.ohuang.fakescreen.SmallWindowView
import com.ohuang.fakescreen.setTouchNoMoveClickListener

class BlackButtonSmallWindow(activity: Activity) : SmallWindow(activity) {

    var callBack: (() -> Unit)? = null
    override fun createSmallView(): View {
        val windowView =
            LayoutInflater.from(activity)
                .inflate(R.layout.small_start_black, null) as SmallWindowView
        windowView.wm = smallWindowsHelper.mWindowManager
        windowView.setWmParams(smallWindowsHelper.mLayoutParams)
        val tv_1 = windowView.findViewById<TextView>(R.id.tv_1)
        tv_1.setTouchNoMoveClickListener {
            callBack?.invoke()
        }
        return windowView
    }
}